var id;
var baseurl;
$(function () {
    getPic();
    scrollbar();
});
//修改滾動條
function scrollbar() {
    $("html").perfectScrollbar();
}

function toJsp(name) {
    var  path="avicit/im/lantop/employeeshortcutkeys/imgs/"+name;
    // parent.Assignment(path);
    parent.document.getElementById("SHORTCUT_KEY_PICTURE").value = path;
    parent.$('#remind').dialog("close");
}

function getPic() {
    $.ajax({
        type: "GET",
        url: 'platform/employeeshortcutController/getPic',
        dataType: "json",
        success: function (data) {
            var fileStr="<table width=\"100%\">";
            var lengths=0;
            for(var i=0;i<data.length;i++ ){
                if(lengths==0){
                    fileStr +="<tr>";
                }
                lengths=lengths+1;
                fileStr +="<td><div onClick='toJsp(\""+data[i]['imgName']+"\")'>";
                fileStr +="<img src=\""+data[i]['picAddr']+"\" /> </div></td>";
                if(lengths==3 || i==data.length-1){
                    fileStr +="</tr>";
                    lengths=0;
                }

            }
            fileStr +="</table>";
            $("#foot").html(fileStr);
        }
    });
}